var escomplex = require('escomplex');
var walker = require('escomplex-ast-moz');

function Routes(app){
	
	app.post('/analyze', function(req, res){	
		var ast = JSON.parse(req.body.json);
		res.json(escomplex.analyse(ast, walker));
	});
}

module.exports = Routes;